package com.eqdd.yiqidian.ui.gongneng.renshi;

import android.view.View;

import com.eqdd.annotation.datasave.DealCodeClass;
import com.eqdd.yiqidian.box.ItemDecoration.SectionDividerItemDecoration;
import com.eqdd.yiqidian.bean.EnterBean;
import com.eqdd.yiqidian.ui.base.BaseEnterActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.check.HRCheckActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.gonggao.GonggaoGuanliActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.kaoqin.KaoqinGuanliActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.contract.ContractManageActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.qiyewenhua.QiyewenhuaActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.quanxian.AuthorityActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.renliziyuangongju.RenliziyuanGongjuActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.train.HRTrainActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.xinchoufuli.XinchouFuliGuanliActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.yuangongdangan.YuangongDanganActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.zhaopinguanli.ZhaopinGuanliActivity;
import com.eqdd.yiqidian.ui.gongneng.renshi.zuzhiguanli.ZuzhiGuanliActivity;
import com.eqdd.yiqidian.utils.DensityUtil;
import com.eqdd.yiqidian.utils.ToastUtil;

/**
 * Created by lvzhihao on 17-4-19.
 */

public class RenshiActivity extends BaseEnterActivity {
    private Class[] classes = new Class[]{
            HRCheckActivity.class,
            ZuzhiGuanliActivity.class,
            KaoqinGuanliActivity.class,
            YuangongDanganActivity.class,
            ContractManageActivity.class,
            AuthorityActivity.class,
            GonggaoGuanliActivity.class,
            QiyewenhuaActivity.class,
            HRTrainActivity.class,
            ZhaopinGuanliActivity.class,
            XinchouFuliGuanliActivity.class,
            RenliziyuanGongjuActivity.class,
    };

    @DealCodeClass(classes = {HRCheckActivity.class})
    public void updateShenpi(int num) {
        updateNum(0, num);
    }

    @DealCodeClass(classes = {ContractManageActivity.class})
    public void updateLaodonghetong(int num) {
        updateNum(4, num);
    }

    @DealCodeClass(classes = {YuangongDanganActivity.class})
    public void updateYuandongdangan(int num) {
        updateNum(3, num);
    }


    @Override
    public void itemClick(int p) {
        if (classes[p] != null) {
            startActivity(classes[p]);
        } else {
            ToastUtil.showShort("该模块暂未开发");
        }
    }

    @Override
    public void initEnterData() {
        isDealCode = true;
        initTopTitleBar(View.VISIBLE, "人事");
        enterBeans.add(new EnterBean("人事的审批"));
        enterBeans.add(new EnterBean("组织管理"));
        enterBeans.add(new EnterBean("考勤管理"));
        enterBeans.add(new EnterBean("员工档案管理"));
        enterBeans.add(new EnterBean("劳动合同管理"));
        enterBeans.add(new EnterBean("权限设置"));
        enterBeans.add(new EnterBean("公告-小喇叭管理"));
        enterBeans.add(new EnterBean("企业文化"));
        enterBeans.add(new EnterBean("培训管理"));
        dataBinding.recyclerView.addItemDecoration(
                new SectionDividerItemDecoration(this)
                        .setLeftPadding(DensityUtil.percentW(30))
                        .setRightPadding(DensityUtil.percentW(30)));
    }

    @Override
    public void lastRun() {
        if (register != null) {
            ((RenshiActivity$$DealCodeInjector) register).update1();
            ((RenshiActivity$$DealCodeInjector) register).update2();
            ((RenshiActivity$$DealCodeInjector) register).update3();
        }
    }
}
